package com.itnetwork.Utilities;
import java.util.Date; 

import net.sf.json.JsonConfig; 
import net.sf.json.util.CycleDetectionStrategy; 
 
public class JsonUtil { 
  public static JsonConfig configJson(String datePattern) { 
    JsonConfig jsonConfig = new JsonConfig(); 
    jsonConfig.setExcludes(new String[] { "" }); 
    jsonConfig.setIgnoreDefaultExcludes(false); 
    jsonConfig.setCycleDetectionStrategy(CycleDetectionStrategy.LENIENT); 
    jsonConfig.registerJsonValueProcessor(Date.class, 
        new JsonDateValueProcessor(datePattern)); 
 
    return jsonConfig; 
  } 
}